﻿<!DOCTYPE html>
<html lang="zh">

<head resource>
    <include file="../inc/meta.inc" /> 
    <title>课程中心</title>
</head>

<body>

    <div id="vapp" v-cloak>
        <page_header ref='header' @login="acc=>account = acc" @load="(o,c,p)=>{org=o,config=c,platinfo=p}"  @search="search">
            loading
            ...
        </page_header>

        <context class="navig">
            <breadcrumb ref="breadcrumb" :subjects="subjects" :current="sbjCurrent"></breadcrumb>
            <div class="bar" v-if="query.search.length>0">
                <div>查询：</div>
                <div>
                    <el-tag type="success" closable @close="$refs['header'].changesearch('')">{{query.search}}</el-tag>
                </div>
            </div>
            <div class="bar subject" v-if="sbj_children.length>0">
                <div>专业：</div>
                <div>
                    <el-tag v-for="tag in sbj_children" :key="tag.Sbj_ID" @click="setSbjChilds(tag.Sbj_ID)"
                        :type="tag.Sbj_Name" v-if="sbj_children!=null && sbj_children.length>0">
                        {{tag.Sbj_Name}}
                    </el-tag>
                    <el-tag type="info" v-if="!sbj_children" @close="setSbjChilds(sbjCurrent.Sbj_PID)" closable>
                        (没有下级专业)</el-tag>
                </div>               
                <div v-if="loading_init">
                    <loading></loading>
                </div>
            </div>
        </context>

        <context v-infinite-scroll="load_infinite_datas" :class="issearch ? 'coursebox' : 'subjectbox'"
            :infinite-scroll-disabled="infinite_disabled()">
            <template v-if="!issearch">
                <subject_show v-for="sbj in sbjcourses" :subject="sbj" :org="org" :count="6" :mincount="1" order="rec"
                    @complete="()=>sbj_load_count++">
                </subject_show>
                <div  loading="p7" v-if="loading_init"></div>
                <div v-if="!loading_init && sbjcourses.length<1 && sbj_load_count==0" class="nocourse">
                    <icon>&#xe849</icon>
                    没有满足条件的课程
                </div>
            </template>
            <template v-else>
                <template v-if="courses && courses.length>0">
                    <course v-for="(c,i) in courses" :item="c" :org="org" :class="{'fourth':(i+1)%4==0}"></course>
                </template>
                <div v-else-if="!loading_cou" class="nocourse">
                    <icon>&#xe849</icon>
                    没有满足条件的课程
                </div>
            </template>
            <loading v-if="loading_cou" class="loading_cou">loading ...</loading>
        </context>

        <el-backtop target="#vapp" style="font-size: 12px;width: 20px;">返回顶部</el-backtop>

        <page_footer :organ="org" :account="account">loading ...</page_footer>
    </div>


</body>

</html>